import config from "../../config/index.js";
import tool from "../../utils/tool.js";

import el_zh_cn from '../../../lib/element-plus@2.3.3/lib/locale/lang/zh-cn.js'
import el_en from '../../../lib/element-plus@2.3.3/lib/locale/lang/en.js'

import zh_cn from './lang/zh-cn.js'
import en from './lang/en.js'

const messages = {
    'zh-cn': {
        el: el_zh_cn,
        ...zh_cn
    },
    'en': {
        el: el_en,
        ...en
    }
}

const i18n = VueI18n.createI18n({
    locale: tool.data.get("APP_LANG") || config.LANG,
    fallbackLocale: 'zh-cn',
    globalInjection: true,
    messages,
})

export default i18n;
